﻿@{
    ViewBag.Title = "EqpForm";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script src="~/js/md5/jquery.md5.js"></script>
<script>
    layui.use(['jquery', 'form', 'laydate', 'common', 'optimizeSelectOption'], function () {
        var form = layui.form,
            $ = layui.$,
            common = layui.common;
        var keyValue = $.request("keyValue");
        $(function () {
            $("#EqpId").bindSelect({
                url: "/EquipmentManage/Equipment/GetListJson",
                id: "F_Id",
                text: "F_EqpName"
            });
            if (!!keyValue) {
                $("#EqpId").val(keyValue);
            }
            form.render();
        });
        wcLoading.close();
        //监听提交
        form.on('submit(saveBtn)', function (data) {
            common.submitForm({
                url: "/RunMonitor/EqpScanScreen/CheckPassword",
                param: { password: $.md5($.trim($('#password').val()))  },
                success: function () {
                    localStorage.setItem("currentEqp", data.field.EqpId);
                    parent.keyValue = data.field.EqpId;
                    parent.getData();
                }
            })
            return false;
        });
    });
</script>
<div class="layui-form select_option_to_layer" lay-filter="adminform">
    <div style="margin: 25px; margin-left: 40px; margin-right: 40px;">
        <div class="layui-form-item required">
            <input type="password" id="password" lay-verify="required|password" placeholder="密码" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-item required">
            <select id="EqpId" name="EqpId" lay-verify="required">
            </select>
        </div>
        <div class="layui-form-item layui-hide">
            <button class="layui-btn site-demo-active" lay-submit id="submit" lay-filter="saveBtn">确认保存</button>
        </div>
    </div>
</div>

